<template>
  <div class="content" flex="dir:top main:justify">
    <div class="top">
      <div flex="main:center cross:center">
        <img src="@/assets/img_qingqin/module8/radar_icon.png">
        <div style="margin-left: 24px">
          <span class="dight"><countTo
            :start-val="0"
            :end-val="d2Data.d2_total_num"
            :duration="3000"
          /></span>
          人
          <div style="margin-top: 12px; font-size: 42px">D小二人数</div>
        </div>
      </div>
      <div flex="main:center cross:center">
        <img src="@/assets/img_qingqin/module8/radar_icon.png">
        <div style="margin-left: 24px">
          <span class="dight"><countTo
            :start-val="0"
            :end-val="d2Data.total_payment_amount"
            :duration="3000"
          /></span>
          万元
          <div style="margin-top: 12px; font-size: 42px">累计兑付金额</div>
        </div>
      </div>
      <div flex="main:center cross:center">
        <img src="@/assets/img_qingqin/module8/radar_icon.png">
        <div style="margin-left: 24px">
          <span class="dight"><countTo
            :start-val="0"
            :end-val="d2Data.total_payment_company_num"
            :duration="3000"
          /></span>
          家
          <div style="margin-top: 12px; font-size: 42px">累计兑付企业数</div>
        </div>
      </div>
    </div>
    <img
      class="line"
      width="100%"
      src="@/assets/img_qingqin/module8/line.png"
    >
    <div class="bottom">
      <div>
        <span class="dight"><countTo
          :start-val="0"
          :end-val="d2Data.total_company_num"
          :duration="3000"
        /></span>
        家
        <p>
          <img
            style="vertical-align: middle"
            src="@/assets/img_qingqin/module8/mark.png"
          >
          全街道企业数
        </p>
      </div>
      <div>
        <span class="dight"><countTo :start-val="0" :end-val="d2Data.total_tax" :duration="3000" /></span>
        亿元
        <p>
          <img
            style="vertical-align: middle"
            src="@/assets/img_qingqin/module8/mark.png"
          >
          累计税收
        </p>
      </div>
      <div>
        <span class="dight">
          <countTo :start-val="0" :end-val="d2Data.total_in" :duration="3000" />
          <!-- {{ d2Data.total_in || '--' }}</span>  --></span>家
        <p>
          <img
            style="vertical-align: middle"
            src="@/assets/img_qingqin/module8/mark.png"
          >
          年度迁入企业
        </p>
      </div>
      <div>
        <span class="dight">
          <countTo :start-val="0" :end-val="d2Data.total_new" :duration="3000" />
        </span> 家
        <p>
          <img
            style="vertical-align: middle"
            src="@/assets/img_qingqin/module8/mark.png"
          >
          年度设立企业
        </p>
      </div>
    </div>
  </div>
</template>
<script>
import countTo from 'vue-count-to'
import { d2 } from '@/api/home'
export default {
  components: { countTo },
  data() {
    return {
      d2Data: {}
    }
  },
  async created() {
    // d2().then(res => {
    //   console.log(res)
    //   this.d2Data = res.data
    // })
    this.d2Data = (await d2().catch(() => ({}))).data || {}
  }
}
</script>
<style lang="scss" scoped>
.content {
  font-size: 28px;
  padding: 40px;
  padding-top: 60px;
  background: url('~@/assets/img_xinyong/xyt_module_bg1.png') !important;
  background-size: 100% 100%;
  height: 100%;
  .top {
    display: flex;
    justify-content: space-around;
    align-items: center;
    color: #cbeaff;
    .dight {
      font-size: 80px;
      color: #fad900;
    }
  }
  .line {
    margin: 44px 0;
  }
  .bottom {
    display: flex;
    justify-content: space-around;
    color: #cbeaff;
    .dight {
      font-size: 60px;
      color: #39fff5;
      padding-left: 40px;
    }
  }
}
</style>
